<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel="stylesheet" href="<c:url value="/resources/css/jquery-ui.css"/>" />
    <script src="<c:url value="/resources/script/jquery/jquery-1.8.3.js"/>"></script>
    <script src="<c:url value="/resources/script/jquery/jquery-ui.js"/>"></script>
<script>
$(function() {
	 var availableTags =[
		<c:forEach var="user" items="${user}" varStatus="status">
			"${user.name}",
    	</c:forEach>
		];
	 
    $( "#searchs" ).autocomplete({
        source: availableTags
    });
});
</script>

</head>
<body>
<table>

		<tr>
		<td><h2>Find Item By User's Item Name</h2></td>
		</tr>
		<tr>
			<td>
				<form name="formSearch" action="<c:url value="onUser"/>" method="post">
				<table id="rounded-corner">
				<tr>
					<td><label for="search"> Search</label> </td>
					<td ><input id="searchs" type="text" name="searchs" size="80" class="input" value="${userSearch}"/></td>
					<td>
						<a onclick="document.formSearch.submit()" href="<c:url value="#"/>" >
							<img alt="" src="<c:url value="/resources/images/images/search.png"/>">
						</a>
					</td>
				</tr>	
				</table>
				</form>
			</td>
		</tr>
		<tr>
				<td>
					<table id="rounded-corner"
						summary="2007 Major IT Companies' Profit">
						<thead>
							<tr>
								<th scope="col" class="rounded-company"></th>
								<th scope="col" class="rounded"><b>Code</b>
								</th>
								<th scope="col" class="rounded"><b>Category</b>
								</th>
								<th scope="col" class="rounded"><b>Type</b>
								</th>
								<th scope="col" class="rounded"><b>Brand</b>
								</th>
								<th scope="col" class="rounded-q4"><b>Condition</b>
								</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach var="searchItem" items="${searchItem}" varStatus="status">
								<tr>
									<td>${status.index + pagingInfo.offset + 1}</td>
									<td>${searchItem.item.code}</td>
									<td>${searchItem.item.category.categoryName}</td>
									<td>${searchItem.item.type.itemType}</td>
									<td>${searchItem.item.brand.brandName}</td>
									<td>${searchItem.item.condition}</td>
								</tr>
							</c:forEach>
						</tbody>
						<tfoot>
							<tr>
								<td colspan="5" class="rounded-foot-left"><em>@Xsis
										Mitra Utama</em>
								</td>
								<td class="rounded-foot-right">&nbsp;</td>

							</tr>
						</tfoot>
					</table>
				</td>
			</tr>
		</table>
</body>
</html>